package org.steven.crm.app.api.processor;

import com.steven.validate.StringValidator;
import com.steven.xweb.web.CheckList;
import org.steven.crm.app.api.processor.base.BaseCURDProcessor;
import org.steven.crm.core.service.BaseService;
import org.steven.crm.core.service.customer.CustomerService;

/**
 * @Author wuzw
 * @Date 2024/6/27 0:19
 * @Version 1.0
 */
public class CustomerProcessor extends BaseCURDProcessor {
    private static CustomerService service = new CustomerService();
    @Override
    protected BaseService getService() {
        return service;
    }

    public boolean saveActionCheck() throws Exception {
        CheckList checkList = getChecklist();
        checkList.addCheckItem(new StringValidator("name", "客户名称", getStringData("name"), true));
        checkList.addCheckItem(new StringValidator("linkman", "联系人", getStringData("linkman"), true));
        checkList.addCheckItem(new StringValidator("linkPhone", "联系电话", getStringData("linkPhone"), true));
        return checkList.check();
    }
}
